<template>
  <div class="app-container home">
    <img src="@/assets/images/index.png" style="width:1320px;height:590px;  opacity:0.9" >
    <section class="chart-container">
        <el-row>                     
            <el-col :span="12">
                <div id="chartPie" style="width:100%; height:400px;"></div>
            </el-col>          
        </el-row>
    </section>
    <div id="renming">
      <img src="@/assets/images/renming.png" style="width:500px;height:200px;  opacity:0.9" >
    </div>
    
  </div>
</template>

<script>
import { getCache } from "@/api/monitor/cache";
import * as echarts from "echarts";

export default {
  name: "Index",
  data() {
    return {
      // 版本号
      version: "3.8.5",
      chartPie: null,
      memberlist:[]
    };
  },
  methods: {
    goTarget(href) {
      window.open(href, "_blank");
    },
    drawPieChart() {
               getCache().then((response) => {
                this.memberlist = response.data.huiyuanbiao
                var a =32;
                var b =9;
                var c =16; 

                this.chartPie = echarts.init(document.getElementById('chartPie'));
                this.chartPie.setOption({
                    title: {
                        text: '纳税类型占比',
                        subtext: '实时同步',
                        x: 'center'
                    },
                    tooltip: {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        orient: 'vertical',
                        left: 'left',
                        data: ['个人', '公司', '个体']
                    },
                    series: [
                        {
                          name: '访问来源',
                          type: 'pie',
                          radius: '55%',
                          center: ['50%', '60%'],
                          data: [
                              { value:a, name: '个人' },
                              { value:b, name: '公司' },
                              { value:c, name: '个体' },

                          ],
                    itemStyle: {
                        emphasis: {
                          shadowBlur: 10,
                          shadowOffsetX: 0,
                          shadowColor: 'rgba(0, 0, 0, 0.5)'
                         }
                   }
                  }
               ]
                });
               })
            },
            drawCharts() {
                this.drawPieChart()
            },
        },
 
        mounted: function () {
            this.drawCharts()
        },
};
</script>

<style scoped lang="scss">
#renming{
  margin-top: -500px;
  margin-left: 700px;
}
.chart-container {
        margin-top: -600px;
        width: 100%;
        float: left;
    }
.el-col {
        padding: 30px 20px;
    }

.home {
  blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 17.5px;
    border-left: 5px solid #eee;
  }
  hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
  }
  .col-item {
    margin-bottom: 20px;
  }

  ul {
    padding: 0;
    margin: 0;
  }

  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #676a6c;
  overflow-x: hidden;

  ul {
    list-style-type: none;
  }

  h4 {
    margin-top: 0px;
  }

  h2 {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 100;
  }

  p {
    margin-top: 10px;

    b {
      font-weight: 700;
    }
  }

  .update-log {
    ol {
      display: block;
      list-style-type: decimal;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 0;
      margin-inline-end: 0;
      padding-inline-start: 40px;
    }
  }
}
</style>

